// Simple script to scan for potential ArkTS type errors
const fs = require('fs');
const path = require('path');

const filePath = 'entry/src/main/ets/pages/Index.ets';

try {
  const content = fs.readFileSync(filePath, 'utf8');
  console.log('Checking file for potential type errors:');
  console.log('===========================================');
  
  // Check for string values that might need enum replacement
  const stringProps = [
    'fontWeight\(.*?\)',
    'alignItems\(.*?\)',
    'justifyContent\(.*?\)',
    'objectFit\(.*?\)'
  ];
  
  stringProps.forEach(prop => {
    const regex = new RegExp(prop, 'g');
    const matches = content.match(regex);
    if (matches) {
      console.log(`Found potential type issues with: ${prop}`);
      matches.forEach(match => {
        console.log(`  - ${match}`);
      });
    }
  });
  
  // Check for position with percentage values
  const positionRegex = /\.position\(\{.*?\}\)/g;
  const positionMatches = content.match(positionRegex);
  if (positionMatches) {
    console.log('\nChecking position properties:');
    positionMatches.forEach(match => {
      console.log(`  - ${match}`);
    });
  }
  
  console.log('\nCheck complete.');
} catch (error) {
  console.error('Error reading file:', error.message);
}